using System.Xml.Serialization;

namespace Opo.Perspective.Core
{
    /// <summary>
    /// Represents information about a city
    /// </summary>
    [XmlRoot("city")]
    public class CityInfo : ICityInfo
    {
        /// <summary>
        /// Gets or sets the postal code.
        /// </summary>
        /// <value>The postal code.</value>
        [XmlElement("postalCode")]
        public string PostalCode { get; set; }
        /// <summary>
        /// Gets or sets the city's name.
        /// </summary>
        /// <value>The city's name.</value>
        [XmlElement("cityName")]
        public string Name { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="CityInfo"/> class.
        /// </summary>
        public CityInfo() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="CityInfo"/> class.
        /// </summary>
        /// <param name="cityName">Name of the city.</param>
        public CityInfo(string cityName) : this(cityName, "") { }
        /// <summary>
        /// Initializes a new instance of the <see cref="CityInfo"/> class.
        /// </summary>
        /// <param name="cityName">Name of the city.</param>
        /// <param name="postalCode">The postal code.</param>
        public CityInfo(string cityName, string postalCode)
        {
            Name = cityName;
            PostalCode = postalCode;
        }
    }
}